This invention relates to a method of extracting line segments. More particularly, the invention relates to a line-segment extracting method for extracting lines, such as contour lines and boundaries (edges) between light and dark areas, from the image of an object.
Great importance is attached to image measurement in industrial technology. The reason for this is that using an image makes it possible to acquire an enormous amount of information in a short period of time. However, since a large quantity of data is arrayed in two dimensions, it is difficult for an image to be comprehended by a machine such as a robot. Since a robot is required to move while avoiding obstacles and to perform precise operations involving objects, the robot must be able to correctly comprehend its surrounding environment, the particular object, etc. Accordingly, there is demand for a processing method and apparatus for line-segment extraction in which line segments such as the contour line of an object or the boundary (edge) between light and dark areas of the object can be extracted from the image of the object correctly and at high speed.
One example of a prior-art method used to extract line segments involves executing edge emphasizing processing using a two-dimensional filter and then estimating straight lines by means of a least square approximation. Another method relies upon a Hough conversion.
However, processing using a two-dimensional filter is local processing and therefore is susceptible to noise. In addition, in order to apply the method of least squares, clustering of a group of points is essential. More specifically, before the method of least squares is applied, it is necessary to separately detect where the straight line begins and where it ends. This is impractical.
The method based upon the Hough conversion is a line-segment extracting method for a case in which it is assumed that a straight line having an infinite extension exists. Consequently, the positions of end points cannot be determined from the results of conversion. Moreover, if part of an image includes a straight line and noise is present in the vicinity of the extension of the line, detection accuracy declines owing to interference ascribable to the noise. Furthermore, since the peak height (frequency) of points plotted on a .rho.-.theta. plane by the Hough conversion is influenced by the length of a straight line, adjustment of a threshold value is difficult when detecting the peak.
Accordingly, an object of the present invention is to provide a method and apparatus for extracting line segments, in which line segments such as contours or edges can be detected accurately and at high speed without being influenced by interference from noise.
Another object of the present invention is to provide a method and apparatus for extracting line segments that make it possible to obtain the end points of a line segment.
A further object of the present invention is to provide a method and apparatus for extracting line segments in which the hardware configuration for line-segment extraction can be made more compact and LSI techniques can be employed.